﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ExtendADSchema
{
    static class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Are you sure to extend Active Directory schema by addiding attribute mappedDisk?\nThis operation CANNOT be reversed\nContinue? (Y/N):");
            string answer = Console.ReadLine();
            if(answer.Equals("y", StringComparison.CurrentCultureIgnoreCase))
            {
                Console.WriteLine("extending schema...");
                try
                {
                    ExtendSchema.Extend();
                    Console.WriteLine("Schema extended successfully.");                    
                }
                catch(Exception e)
                {
                    Console.WriteLine("Error: {0}\n{1}\nStack trace:\n{2}", e.GetType().Name, e.Message, e.StackTrace);
                }
                Console.WriteLine("Press [Enter] to exit.");
                Console.ReadLine();
            }
            else
            {
                Console.WriteLine("Schema extending aborted.\nPress [Enter] to exit.");
                Console.ReadLine();
            }
        }
    }
}
